package com.test.deencredit.bean_deencredit.userinfo_deencredit;

import android.text.TextUtils;

import com.google.gson.Gson;

import org.json.JSONObject;

public class OthersInfo_deencredit {

    private static class Inner_deencredit {
        private static OthersInfo_deencredit instance_deencredit = new OthersInfo_deencredit();
    }

    private OthersInfo_deencredit(){}

    public static OthersInfo_deencredit getInstance_deencredit(){
        return Inner_deencredit.instance_deencredit;
    }

    public static void parse_deencredit(JSONObject objJson){
        Inner_deencredit.instance_deencredit = new Gson().fromJson(objJson.toString(), OthersInfo_deencredit.class);
    }

    //还款链接，获取后置空
    private String rpPath;
    //发送验证码响应参数，获取后置空
    private JSONObject sendOtpCodeJson;
    //图片上传后返回的链接，获取后置空
    private String imgPath;

    //法语区绑卡时返回的运营商
    private String channel;
    //法语区绑卡时返回的 是否需要绑定运营商Flag
    private String addBindFlag;


    public String getRpPath_deencredit() {
        if (TextUtils.isEmpty(rpPath)) return "";
        String result = rpPath;
        rpPath = "";
        return result;
    }

    public JSONObject getSendOtpCodeJson_deencredit() {
        JSONObject result = sendOtpCodeJson;
        sendOtpCodeJson = null;
        return result;
    }

    public String getImgPath_deencredit() {
        if (TextUtils.isEmpty(imgPath)) return "";
        String resulet = imgPath;
        imgPath = "";
        return resulet;
    }

    public void setRpPath_deencredit(String rpPath) {
        this.rpPath = rpPath;
    }

    public void setSendOtpCodeJson_deencredit(JSONObject sendOtpCodeJson) {
        this.sendOtpCodeJson = sendOtpCodeJson;
    }

    public void setImgPath_deencredit(String imgPath) {
        this.imgPath = imgPath;
    }

    public void setChannel_deencredit(String channel) {
        this.channel = channel;
    }

    public String getChannel_deencredit() {
        if (TextUtils.isEmpty(channel)) return "";
        return channel;
    }

    public void setAddBindFlag_deencredit(String addBindFlag) {
        this.addBindFlag = addBindFlag;
    }

    public boolean getAddBindFlag_deencredit() {
        if (TextUtils.isEmpty(addBindFlag)) return false;
        if (addBindFlag.equalsIgnoreCase("YES")){
            addBindFlag = "NO";
            return true;
        }
        return false;
    }


}
